package com.zhangh.summer.admin.model.base;

import com.zhangh.summer.admin.support.ds.common.pager.Pager;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * @description: TODO
 * @author: zhanghui  zhanghlucky@163.com
 * @create: 2021-06-10 23:04
 **/
@Setter
@Slf4j
public abstract class AbstractPager {
    private Integer page;
    private Integer size;

    private Pager pager;

    public Pager getPager(){
        if (null==page || page<=0){
            log.debug("page is {} ,reset page to 1",page);
            page=1;

        }
        if (null==size || size<=0){
            log.debug("size is {} ,reset size to 20",size);
            size=20;
        }
        pager=new Pager(page,size);
        return pager;
    }
}
